﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Cci;
using CSharpSourceEmitter;
using System.IO;

namespace ReactiveLang.AssemblyRewriter
{
    static class Util
    {
        public static string ToCSharpString(this IExpression expression)
        {
            var result = new StringWriter();
            var output = new SourceEmitterOutputTextWriter(result);

            SourceEmitter emitter = new SourceEmitter(output);
            emitter.Visit(expression);

            return result.ToString();
        }
    }
}
